package com.example.xadmin.controller;

import com.example.xadmin.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping
public class AdminController {

    @Autowired
    private SysUserService service;

    @RequestMapping
    public String index(){
        return "index";
    }


    @GetMapping("/user")
    @ResponseBody
    public Object getUser(){
        return service.list();
    }

}
